﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

namespace WebApplication
{
    public class Global : System.Web.HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {

        }

        protected void Application_AcquireRequestState(object sender, EventArgs e)
        {
            string[] authorizeFiles = new string[] { "/Art/Edit.aspx", "/Project/Edit.aspx" };
            List<string> authorizeFilesList = new List<string>(authorizeFiles);

            if (authorizeFilesList.Contains(Request.CurrentExecutionFilePath))
            {
                if (Session["UID"] == null)
                {
                    Response.Redirect("/Login.aspx?redirect=" + Request.ServerVariables["Path_Info"]);
                }
            }
        }
    }
}